//
//  Type.swift
//  Trans
//
//  Created by zcj on 2024/10/30.
//

import Foundation


typealias INT32 = Int32
typealias UINT32 = UInt32
typealias FSIZE = UInt64
typealias BDATA = Data
typealias ConId = Int64 // 网络连接的id
typealias WinId = Int64 //windowID，打开和关闭窗口
typealias FileId = Int64 // 文件的id识别



let SCAN_MESSAGE_REQ = INT32(1)
let SCAN_MESSAGE_ANS = INT32(2)

let STRING_MESSAGE = UINT32(3)
let FILE_MESSAGE_REQ = UINT32(4) // 请求传输文件
let FILE_MESSAGE_ANS = UINT32(5) // 回应传输文件
let FILE_DATA = UINT32(6)  //  文件data

let FILE_CANCEL = UINT32(7)  //  文件传输取消，双方可以发送
let FILE_STOP = UINT32(8)  //  文件传输暂停，双方可以发送，需要log保存文件信息

let FILE_RESUME = UINT32(11) //文件传输恢复

let RECONNECT = UINT32(12)

//还未用上
let FILE_DATA_RECEIVE = UINT32(19)  //  文件data 接受回应
let SPEED_REQ = UINT32(20) //设置文件传输速度，由于文件传输主要是传输方来控制，所以主要有接受方来发送这个协议

enum TERMINALSIDE:INT32{
    case CLIENT = 0
    case LISTENER = 1
}



let timeoutInterval: TimeInterval = 60*10 // 10 minutes


let GBSize:Double = pow(1000, 3)
let MBSize:Double = pow(1000, 2)
let KBSize:Double = 1000




